<template>
    <div class="wrap">
        <div class="title">自我评价</div>
        <textarea class="textarea" v-model="content" placeholder="请输入自己的工作经验或实习经验~"></textarea>
        <div class="theme-btn btn" @click="submit">保存</div>
    </div>
</template>
<script>
export default {
    data () {
        return {
            content: ''
        };
    },
    methods: {
        submit() {
            if(!this.content.trim()){
                wx.showToast({
                    title: '工作经验不能为空',
                    icon: 'none',
                    duration: 2000,
                    mask: false,
                });
                return;
            }
            this.$api.saveEditSelfEvaluation({
                selfEvaluation: this.content
            }).then(res=>{
                if(res.code == 0){
                    wx.navigateBack({
                      delta: 1 //返回的页面数，如果 delta 大于现有页面数，则返回到首页,
                    });
                }
            });
        }
    },
    onLoad(e) {
        if(e.item){
            this.content = e.item;
        }
    }
}
</script>
<style lang="scss" scoped>
.wrap {
    padding: 15px;
}
.title {
    line-height: 24px;
    font-size: 13px;
    color: #40444C;
}
.textarea {
    width: 100%;
    height: 167px;
    border-radius: 4px;
    border: 1px solid $grey-border-color;
    padding: 10px 15px;
    box-sizing: border-box;
}
.btn {
    position: absolute;
    bottom: 36px;
    left: 15px;
    right: 15px;
}
</style>